<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Compare priorities in order to place elements correctly in the heap while sifting up.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.splpriorityqueue.html">SplPriorityQueue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="splpriorityqueue.construct.html">SplPriorityQueue::__construct</a></div>
 <div class="up"><a href="class.splpriorityqueue.html">SplPriorityQueue</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="splpriorityqueue.compare" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplPriorityQueue::compare</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">SplPriorityQueue::compare</span> &mdash; <span class="dc-title">Compare priorities in order to place elements correctly in the heap while sifting up.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-splpriorityqueue.compare-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>SplPriorityQueue::compare</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$priority1</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$priority2</code></span>
   )</div>


  <p class="para rdfs-comment">
   Compare <em><code class="parameter">priority1</code></em> with <em><code class="parameter">priority2</code></em>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-splpriorityqueue.compare-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">priority1</code></em></dt>

     <dd>

      <p class="para">
       The priority of the first node being compared.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">priority2</code></em></dt>

     <dd>

      <p class="para">
       The priority of the second node being compared.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splpriorityqueue.compare-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Result of the comparison, positive integer if <em><code class="parameter">priority1</code></em> is greater than <em><code class="parameter">priority2</code></em>, 0 if they are equal, negative integer otherwise.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Multiple elements with the same priority will get dequeued in no particular order.
   </p>
  </p></blockquote>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.splpriorityqueue.html">SplPriorityQueue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="splpriorityqueue.construct.html">SplPriorityQueue::__construct</a></div>
 <div class="up"><a href="class.splpriorityqueue.html">SplPriorityQueue</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
